#ifndef CONNECTIONSTATE
#define CONNECTIONSTATE

#include <app\states\sessionState.h>

#include <string>

using namespace std;

class connectionState : public sessionState {

public:

  enum ESTATE {
    INIT_STATE,
    CONNECTION_ESTABLISHED,
    CONNECTION_NOT_ESTABLISHED,
    LOGIN_ACCEPTED,
    LOGIN_REJECTED
  };

private:

  static int class_type_id;
  int type_id;

  ESTATE internal_state;
  string user_name;
  string model_name;
  string password;

public:

  static sessionState *create();

  void setPassword(string _password);
  string getPassword();

  void setUserName(string _user_name);
  string getUserName();

  void setModelName(string _model_name);
  string getModelName();

  void setConnectionEstablished(bool value);
  bool isConnectionEstablished();
  bool waitForConnection();

  void setLoginAccepted(bool value);
  bool isLoginAccepted();
  bool waitForLogin();

  void reset();

  static int getClassTypeId();
  virtual int getTypeId();

  connectionState();
  connectionState(ESTATE value);
  virtual ~connectionState();
};

#endif